package com.dcxs.shop.module.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dcxs.shop.module.product.entity.JsProductPay;
import com.dcxs.shop.module.supplier.entity.JsSupplier;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 购物车表
 * </p>
 *
 * @author zzh
 * @since 2020-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class JsCart implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    private Integer  id;

    /**
     * 用户id
     */
    private Integer usrId;

    /**
     * 商品id
     */
    private Integer productId;

    /**
     *  购物车内的商品数量
     */
    private Integer num;


    private Integer specificationId;

    /**
     * 单价
     */
    @TableField(exist = false)
    private BigDecimal price;

    @TableField(exist = false)
    private String productName;

    @TableField(exist = false)
    private String specificationName;

    @TableField(exist = false)
    private BigDecimal weight;

    @TableField(exist = false)
    private String specificationDetailName;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    private Integer priceId;

    @TableField(exist = false)
    private List<JsProductPay> payList;

    @TableField(exist = false)
    private JsSupplier supplier;


    private String productPic;

    @TableField(exist = false)
    private String shareToken;

    private Integer shareUsrId;

    @TableField(exist = false)
    private Integer isFreeShipping;

}
